<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>

    <!-- 当使用了v-model双向绑定了变量时，name属性可简略-->
    <label for="male">男</label>
    <input type="radio" id="male" name="sex" value="1" v-model="sex">
    <label for="female">女</label>
    <input type="radio" id="female" name="sex" value="0" v-model="sex">
    <h3>性别：{{sex}}</h3>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu',
            sex: 0
        }
    })
</script>
</body>
</html>